<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>コントロールパネル</title>
    <link href="./assets/styles/default.css" rel="stylesheet" />
    <script src="./assets/scripts/libs/jquery-1.7.1.min.js" type="text/javascript"></script>
    <script src="./assets/scripts/plugins/jquery.tagsinput.min.js" type="text/javascript"></script>
    <script src="./assets/scripts/import.js" type="text/javascript"></script>
    {include file='staff/include/script.inc.html'}
</head>
<body>

{include file='include/header.inc.html'}

<div id="container">
	<aside id="accordion">
    	<div id="aside_inner">
    		{include file='include/menu.inc.html'}
        </div>
    </aside>
    
    <article>
    	<h2><span>&nbsp;</span>Staff<p><a href="javascript:;">Open Plugins</a></p></h2>
        <nav>
            <ul>
            <li {if !$phase}class="active"{/if}><a href="{$smarty.server.SCRIPT_NAME}"><span>スタッフ検索</span></a></li>
            <li {if $phase == 'input'}class="active"{/if}><a href="{$smarty.server.SCRIPT_NAME}?op=regist"><span>スタッフ登録</span></a></li>
            <li><a href="staff_role.php"><span>ロール検索</span></a></li>
            <li><a href="staff_role.php?op=regist"><span>ロール登録</span></a></li>
            </ul>
        </nav>
        
        <section id="content">
        
        	{if isset($id)}{assign var=operation value='更新'}{else}{assign var=operation value='登録'}{/if}
            <h3>{$operation}</h3>

			{if $phase == 'input'}

				<form name="fm" action="{$smarty.server.SCRIPT_NAME}" method="post" enctype="multipart/form-data">

                    <ul class="t_btns">
                    {if $operation == '更新'}
                        <li class="left delete"><button type="button" class="chk_delete"><em>&nbsp;</em>削除</button></li>
                        <li class="right refresh"><button type="button" class="chk_update"><em>&nbsp;</em>更新</button></li>
                    {else}
                        <li class="single add"><button type="button" class="chk_add"><em>&nbsp;</em>登録</button></li>
                    {/if}
                    </ul>

                    <p class="message">内容を確認し、{$operation}ボタンをクリックしてください。</p>
                    
                    <h4><span>&nbsp;</span>基本情報</h4>
                    {include file='staff/include/form.inc.html'}

                    <h4><span>&nbsp;</span>サイト情報</h4>
                    {include file='staff/include/site_form.inc.html'}

                    <p class="button">
                    {if $operation == '更新'}
                    	<button type="button" class="submit" id="btn_delete"><span>削除</span></button>
                        <button type="button" class="submit btn_submit" id="btn_update"><span>更新</span></button>
                    {else}
						<button type="button" class="submit btn_submit" id="btn_regist"><span>登録</span></button>
					{/if}
                    </p>
                    
                    {if isset($id)}<input type="hidden" name="id" value="{$id}" />{/if}
					<input type="hidden" name="mode" value="" />
					<input type="hidden" name="do" value="{if $operation == '更新'}validate_edit_form{else}validate_regist_form{/if}"/>

	            </form>

			{elseif $phase == 'complete'}
			
				<p class="message">{$message}</p>
				<ul class="result_btn">
					<li><a href="{$smarty.server.SCRIPT_NAME}?op=search">一覧に戻る</a></li>
					<li><a href="{$smarty.server.SCRIPT_NAME}?op=regist">続けて新規登録する</a></li>
                    {if isset($id)}
						<li><a href="{$smarty.server.SCRIPT_NAME}?op=edit&id={$id}">登録した内容を更新する</a></li>
					{/if}
				</ul>
			
			{/if}

        </section>
    </article>
    
</div>

{include file='include/footer.inc.html'}

</body>
</html>